<%--
  Created by IntelliJ IDEA.
  User: xdd
  Date: 2022/7/26
  Time: 12:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="cn.bdqn.news.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<p>EL是用来显示java， Servlet赋值set值到四大作用域，JSP负责get显示四大作用域中的值，推荐EL表达式</p>
<!-- 1.request请求作用域 -->
<%
    request.setAttribute("Hello","Hello World");
%>
<p>${Hello}</p>
<!-- 2.session作用域 -->
<%
    session.setAttribute("username","张三");
%>
<p>用户名：<span style="color: red">${username}</span></p>
<!-- 3.application作用域 -->
<%
    User user = new User();
    user.setUname("admin");
    user.setUpwd("123123");
    user.setUid(1000);
    user.setUrole(2);
    application.setAttribute("user",user);
%>
<p>用户信息：${user.uname},${user.upwd}</p>
<!-- 4.获取参数 -->
<p>参数：${param.id}</p>
<!-- 5.运算 -->
<p>${100+200}</p>
<p>${100>0}</p>
<p>${100 gt 50 and 200 lt 300}</p>
</body>
</html>
